package com.morningstar.gateway.resolver;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @author yls
 */
//@Component("keyResolverUri")
public class KeyResolverUri implements KeyResolver {
    /**
     *
     */
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public Mono<String> resolve(ServerWebExchange exchange) {
        logger.info("uri path {}", exchange.getRequest().getURI().getPath());
        return Mono.just(exchange.getRequest().getURI().getPath());
    }
}
